package vip.xiaonuo.modular.business.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
import vip.xiaonuo.core.pojo.response.ResponseData;
import vip.xiaonuo.core.pojo.response.SuccessResponseData;
import vip.xiaonuo.modular.business.service.ThemeApiService;
import vip.xiaonuo.modular.manage.theme.param.ThemeParam;
import vip.xiaonuo.modular.manage.theme.service.ThemeService;

import javax.annotation.Resource;

/**
 * @Description 主题查询
 * @Author cdx
 * @Date 2022/8/4 14:41
 * @Version 1.0
 */
@Api(tags = "主题查询")
@RestController
public class ThemeApiController {

    @Resource
    private ThemeService themeService;

    @Resource
    private ThemeApiService themeApiService;

    @ApiOperation("主题列表查询")
    @PostMapping("/business/theme/list")
    @BusinessLog(title = "主题查询", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData list(@RequestBody ThemeParam param){
        return new SuccessResponseData(themeService.list(param));
    }

    @ApiOperation("主题数据查询")
    @PostMapping("/business/theme/getThemeData")
    public ResponseData getThemeData(@RequestBody ThemeParam themeParam){
        return new SuccessResponseData(themeApiService.getThemeData(themeParam));
    }

}
